# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=amdgcn-- -O0 -run-pass=legalizer -global-isel-abort=0 -o - %s | FileCheck %s

---
name: test_unmerge_s32_s64
body: |
  bb.0:
    ; CHECK-LABEL: name: test_unmerge_s32_s64
    ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[C]](s64)
    ; CHECK: $vgpr0 = COPY [[UV]](s32)
    ; CHECK: $vgpr1 = COPY [[UV1]](s32)
    %0:_(s64) = G_CONSTANT i64 0
    %1:_(s32), %2:_(s32) = G_UNMERGE_VALUES %0:_(s64)
    $vgpr0 = COPY %1(s32)
    $vgpr1 = COPY %2(s32)
...

---
name: test_unmerge_s32_v2s32
body: |
  bb.0:
    liveins: $vgpr0_vgpr1
    ; CHECK-LABEL: name: test_unmerge_s32_v2s32
    ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
    ; CHECK: $vgpr0 = COPY [[UV]](s32)
    ; CHECK: $vgpr21 = COPY [[UV1]](s32)
    %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
    %1:_(s32), %2:_(s32) = G_UNMERGE_VALUES %0
    $vgpr0 = COPY %1
    $vgpr21= COPY %2
...

---
name: test_unmerge_s16_v2s16
body: |
  bb.0:
    liveins: $vgpr0
    ; CHECK-LABEL: name: test_unmerge_s16_v2s16
    ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
    ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    %0:_(<2 x s16>) = COPY $vgpr0
    %1:_(s16), %2:_(s16) = G_UNMERGE_VALUES %0
    %3:_(s32) = G_ANYEXT %1
    %4:_(s32) = G_ANYEXT %2
    $vgpr0 = COPY %3
    $vgpr1 = COPY %4
...

---
name: test_unmerge_s16_v3s16
body: |
  bb.0:
    ; CHECK-LABEL: name: test_unmerge_s16_v3s16
    ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
    ; CHECK: [[DEF1:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
    ; CHECK: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[DEF]](<4 x s16>)
    ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
    ; CHECK: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY2]](s32)
    %0:_(<3 x s16>) = G_IMPLICIT_DEF
    %1:_(s16), %2:_(s16),  %3:_(s16) = G_UNMERGE_VALUES %0
    %4:_(s32) = G_ANYEXT %1
    %5:_(s32) = G_ANYEXT %2
    %6:_(s32) = G_ANYEXT %3
    $vgpr0 = COPY %4
    $vgpr1 = COPY %5
    $vgpr2 = COPY %6
...

---

name: test_unmerge_s16_v4s16
body: |
  bb.0:
    liveins: $vgpr0_vgpr1
    ; CHECK-LABEL: name: test_unmerge_s16_v4s16
    ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
    ; CHECK: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<4 x s16>)
    ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
    ; CHECK: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY3]](s32)
    ; CHECK: $vgpr3 = COPY [[COPY4]](s32)
    %0:_(<4 x s16>) = COPY $vgpr0_vgpr1
    %1:_(s16), %2:_(s16), %3:_(s16), %4:_(s16) = G_UNMERGE_VALUES %0
    %5:_(s32) = G_ANYEXT %1
    %6:_(s32) = G_ANYEXT %2
    %7:_(s32) = G_ANYEXT %3
    %8:_(s32) = G_ANYEXT %4
    $vgpr0 = COPY %5
    $vgpr1 = COPY %6
    $vgpr2 = COPY %7
    $vgpr3 = COPY %8
...

---
name: test_unmerge_s16_v6s16
body: |
  bb.0:
    liveins: $vgpr0_vgpr1
    ; CHECK-LABEL: name: test_unmerge_s16_v6s16
    ; CHECK: [[COPY:%[0-9]+]]:_(<6 x s16>) = COPY $vgpr0_vgpr1_vgpr2
    ; CHECK: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>), [[UV2:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<6 x s16>)
    ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
    ; CHECK: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
    ; CHECK: [[BITCAST2:%[0-9]+]]:_(s32) = G_BITCAST [[UV2]](<2 x s16>)
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST2]], [[C]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[BITCAST2]](s32)
    ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY3]](s32)
    ; CHECK: $vgpr3 = COPY [[COPY4]](s32)
    ; CHECK: $vgpr4 = COPY [[COPY5]](s32)
    ; CHECK: $vgpr5 = COPY [[COPY6]](s32)
    %0:_(<6 x s16>) = COPY $vgpr0_vgpr1_vgpr2
    %1:_(s16), %2:_(s16), %3:_(s16), %4:_(s16), %5:_(s16), %6:_(s16) = G_UNMERGE_VALUES %0
    %7:_(s32) = G_ANYEXT %1
    %8:_(s32) = G_ANYEXT %2
    %9:_(s32) = G_ANYEXT %3
    %10:_(s32) = G_ANYEXT %4
    %11:_(s32) = G_ANYEXT %5
    %12:_(s32) = G_ANYEXT %6
    $vgpr0 = COPY %7
    $vgpr1 = COPY %8
    $vgpr2 = COPY %9
    $vgpr3 = COPY %10
    $vgpr4 = COPY %11
    $vgpr5 = COPY %12
...

---

name: test_unmerge_s8_s16
body: |
  bb.0:
    liveins: $vgpr0
    ; CHECK-LABEL: name: test_unmerge_s8_s16
    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C2]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    %0:_(s32) = COPY $vgpr0
    %1:_(s16) = G_TRUNC %0
    %2:_(s8), %3:_(s8) = G_UNMERGE_VALUES %1
    %4:_(s32) = G_ANYEXT %2
    %5:_(s32) = G_ANYEXT %3
    $vgpr0 = COPY %4
    $vgpr1 = COPY %5
...

---
name: test_unmerge_s8_s32
body: |
  bb.0:
    liveins: $vgpr0
    ; CHECK-LABEL: name: test_unmerge_s8_s32
    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C2]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY3]](s32)
    ; CHECK: $vgpr3 = COPY [[COPY4]](s32)
    %0:_(s32) = COPY $vgpr0
    %1:_(s8), %2:_(s8), %3:_(s8), %4:_(s8) = G_UNMERGE_VALUES %0
    %5:_(s32) = G_ANYEXT %1
    %6:_(s32) = G_ANYEXT %2
    %7:_(s32) = G_ANYEXT %3
    %8:_(s32) = G_ANYEXT %4
    $vgpr0 = COPY %5
    $vgpr1 = COPY %6
    $vgpr2 = COPY %7
    $vgpr3 = COPY %8
...

---
name: test_unmerge_s8_s48
body: |
  bb.0:
    liveins: $vgpr0_vgpr1
    ; CHECK-LABEL: name: test_unmerge_s8_s48
    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[UV]], [[C]](s32)
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[UV1]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C2]]
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[COPY1]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C2]]
    ; CHECK: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[AND1]], [[COPY3]](s32)
    ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C2]]
    ; CHECK: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[AND2]], [[C1]](s32)
    ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
    ; CHECK: [[COPY8:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY9:%[0-9]+]]:_(s32) = COPY [[LSHR3]](s32)
    ; CHECK: [[COPY10:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[COPY11:%[0-9]+]]:_(s32) = COPY [[LSHR4]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY6]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY7]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY8]](s32)
    ; CHECK: $vgpr3 = COPY [[COPY9]](s32)
    ; CHECK: $vgpr4 = COPY [[COPY10]](s32)
    ; CHECK: $vgpr5 = COPY [[COPY11]](s32)
    %0:_(s64) = COPY $vgpr0_vgpr1
    %1:_(s48) = G_TRUNC %0
    %2:_(s8), %3:_(s8), %4:_(s8), %5:_(s8), %6:_(s8), %7:_(s8) = G_UNMERGE_VALUES %1
    %8:_(s32) = G_ANYEXT %2
    %9:_(s32) = G_ANYEXT %3
    %10:_(s32) = G_ANYEXT %4
    %11:_(s32) = G_ANYEXT %5
    %12:_(s32) = G_ANYEXT %6
    %13:_(s32) = G_ANYEXT %7
    $vgpr0 = COPY %8
    $vgpr1 = COPY %9
    $vgpr2 = COPY %10
    $vgpr3 = COPY %11
    $vgpr4 = COPY %12
    $vgpr5 = COPY %13
...

---
name: test_unmerge_s16_s48
body: |
  bb.0:
    liveins: $vgpr0_vgpr1
    ; CHECK-LABEL: name: test_unmerge_s16_s48
    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[UV]], [[C]](s32)
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[UV1]], [[C]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY3]](s32)
    %0:_(s64) = COPY $vgpr0_vgpr1
    %1:_(s48) = G_TRUNC %0
    %2:_(s16), %3:_(s16), %4:_(s16) = G_UNMERGE_VALUES %1
    %5:_(s32) = G_ANYEXT %2
    %6:_(s32) = G_ANYEXT %3
    %7:_(s32) = G_ANYEXT %4
    $vgpr0 = COPY %5
    $vgpr1 = COPY %6
    $vgpr2 = COPY %7
...

---
name: test_unmerge_s8_s64
body: |
  bb.0:
    liveins: $vgpr0_vgpr1
    ; CHECK-LABEL: name: test_unmerge_s8_s64
    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[UV]], [[C]](s32)
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[UV1]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C2]]
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[COPY1]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C2]]
    ; CHECK: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[AND1]], [[COPY3]](s32)
    ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
    ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C2]]
    ; CHECK: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[AND2]], [[COPY5]](s32)
    ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C2]]
    ; CHECK: [[LSHR5:%[0-9]+]]:_(s32) = G_LSHR [[AND3]], [[C1]](s32)
    ; CHECK: [[COPY8:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[COPY9:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
    ; CHECK: [[COPY10:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY11:%[0-9]+]]:_(s32) = COPY [[LSHR3]](s32)
    ; CHECK: [[COPY12:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[COPY13:%[0-9]+]]:_(s32) = COPY [[LSHR4]](s32)
    ; CHECK: [[COPY14:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[COPY15:%[0-9]+]]:_(s32) = COPY [[LSHR5]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY8]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY9]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY10]](s32)
    ; CHECK: $vgpr3 = COPY [[COPY11]](s32)
    ; CHECK: $vgpr4 = COPY [[COPY12]](s32)
    ; CHECK: $vgpr5 = COPY [[COPY13]](s32)
    ; CHECK: $vgpr6 = COPY [[COPY14]](s32)
    ; CHECK: $vgpr7 = COPY [[COPY15]](s32)
    %0:_(s64) = COPY $vgpr0_vgpr1
    %1:_(s8), %2:_(s8), %3:_(s8), %4:_(s8), %5:_(s8), %6:_(s8), %7:_(s8), %8:_(s8) = G_UNMERGE_VALUES %0
    %10:_(s32) = G_ANYEXT %1
    %11:_(s32) = G_ANYEXT %2
    %12:_(s32) = G_ANYEXT %3
    %13:_(s32) = G_ANYEXT %4
    %14:_(s32) = G_ANYEXT %5
    %15:_(s32) = G_ANYEXT %6
    %16:_(s32) = G_ANYEXT %7
    %17:_(s32) = G_ANYEXT %8
    $vgpr0 = COPY %10
    $vgpr1 = COPY %11
    $vgpr2 = COPY %12
    $vgpr3 = COPY %13
    $vgpr4 = COPY %14
    $vgpr5 = COPY %15
    $vgpr6 = COPY %16
    $vgpr7 = COPY %17
...

---
name: test_unmerge_s8_p1
body: |
  bb.0:
    liveins: $vgpr0_vgpr1
    ; CHECK-LABEL: name: test_unmerge_s8_p1
    ; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](p1)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[UV]], [[C]](s32)
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[UV1]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C2]]
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[COPY1]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C2]]
    ; CHECK: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[AND1]], [[COPY3]](s32)
    ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
    ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C2]]
    ; CHECK: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[AND2]], [[COPY5]](s32)
    ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C2]]
    ; CHECK: [[LSHR5:%[0-9]+]]:_(s32) = G_LSHR [[AND3]], [[C1]](s32)
    ; CHECK: [[COPY8:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[COPY9:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
    ; CHECK: [[COPY10:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY11:%[0-9]+]]:_(s32) = COPY [[LSHR3]](s32)
    ; CHECK: [[COPY12:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[COPY13:%[0-9]+]]:_(s32) = COPY [[LSHR4]](s32)
    ; CHECK: [[COPY14:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[COPY15:%[0-9]+]]:_(s32) = COPY [[LSHR5]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY8]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY9]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY10]](s32)
    ; CHECK: $vgpr3 = COPY [[COPY11]](s32)
    ; CHECK: $vgpr4 = COPY [[COPY12]](s32)
    ; CHECK: $vgpr5 = COPY [[COPY13]](s32)
    ; CHECK: $vgpr6 = COPY [[COPY14]](s32)
    ; CHECK: $vgpr7 = COPY [[COPY15]](s32)
    %0:_(p1) = COPY $vgpr0_vgpr1
    %1:_(s8), %2:_(s8), %3:_(s8), %4:_(s8), %5:_(s8), %6:_(s8), %7:_(s8), %8:_(s8) = G_UNMERGE_VALUES %0
    %10:_(s32) = G_ANYEXT %1
    %11:_(s32) = G_ANYEXT %2
    %12:_(s32) = G_ANYEXT %3
    %13:_(s32) = G_ANYEXT %4
    %14:_(s32) = G_ANYEXT %5
    %15:_(s32) = G_ANYEXT %6
    %16:_(s32) = G_ANYEXT %7
    %17:_(s32) = G_ANYEXT %8
    $vgpr0 = COPY %10
    $vgpr1 = COPY %11
    $vgpr2 = COPY %12
    $vgpr3 = COPY %13
    $vgpr4 = COPY %14
    $vgpr5 = COPY %15
    $vgpr6 = COPY %16
    $vgpr7 = COPY %17
...

---
name: test_unmerge_s4_p1
body: |
  bb.0:
    liveins: $vgpr0_vgpr1
    ; CHECK-LABEL: name: test_unmerge_s4_p1
    ; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](p1)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[UV]], [[C]](s32)
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[UV1]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C2]]
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[COPY1]](s32)
    ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C3]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C2]]
    ; CHECK: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[AND1]], [[COPY3]](s32)
    ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
    ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C4]](s32)
    ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C2]]
    ; CHECK: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[AND2]], [[COPY5]](s32)
    ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
    ; CHECK: [[COPY8:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY8]], [[C2]]
    ; CHECK: [[LSHR5:%[0-9]+]]:_(s32) = G_LSHR [[AND3]], [[COPY7]](s32)
    ; CHECK: [[COPY9:%[0-9]+]]:_(s32) = COPY [[C3]](s32)
    ; CHECK: [[COPY10:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY10]], [[C2]]
    ; CHECK: [[LSHR6:%[0-9]+]]:_(s32) = G_LSHR [[AND4]], [[COPY9]](s32)
    ; CHECK: [[COPY11:%[0-9]+]]:_(s32) = COPY [[C4]](s32)
    ; CHECK: [[COPY12:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY12]], [[C2]]
    ; CHECK: [[LSHR7:%[0-9]+]]:_(s32) = G_LSHR [[AND5]], [[COPY11]](s32)
    ; CHECK: [[COPY13:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
    ; CHECK: [[COPY14:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[AND6:%[0-9]+]]:_(s32) = G_AND [[COPY14]], [[C2]]
    ; CHECK: [[LSHR8:%[0-9]+]]:_(s32) = G_LSHR [[AND6]], [[COPY13]](s32)
    ; CHECK: [[COPY15:%[0-9]+]]:_(s32) = COPY [[C3]](s32)
    ; CHECK: [[COPY16:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[AND7:%[0-9]+]]:_(s32) = G_AND [[COPY16]], [[C2]]
    ; CHECK: [[LSHR9:%[0-9]+]]:_(s32) = G_LSHR [[AND7]], [[COPY15]](s32)
    ; CHECK: [[COPY17:%[0-9]+]]:_(s32) = COPY [[C4]](s32)
    ; CHECK: [[COPY18:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[AND8:%[0-9]+]]:_(s32) = G_AND [[COPY18]], [[C2]]
    ; CHECK: [[LSHR10:%[0-9]+]]:_(s32) = G_LSHR [[AND8]], [[COPY17]](s32)
    ; CHECK: [[COPY19:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[AND9:%[0-9]+]]:_(s32) = G_AND [[COPY19]], [[C2]]
    ; CHECK: [[LSHR11:%[0-9]+]]:_(s32) = G_LSHR [[AND9]], [[C1]](s32)
    ; CHECK: [[COPY20:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[AND10:%[0-9]+]]:_(s32) = G_AND [[COPY20]], [[C2]]
    ; CHECK: [[LSHR12:%[0-9]+]]:_(s32) = G_LSHR [[AND10]], [[C3]](s32)
    ; CHECK: [[COPY21:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[AND11:%[0-9]+]]:_(s32) = G_AND [[COPY21]], [[C2]]
    ; CHECK: [[LSHR13:%[0-9]+]]:_(s32) = G_LSHR [[AND11]], [[C4]](s32)
    ; CHECK: [[COPY22:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[COPY23:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
    ; CHECK: [[COPY24:%[0-9]+]]:_(s32) = COPY [[LSHR3]](s32)
    ; CHECK: [[COPY25:%[0-9]+]]:_(s32) = COPY [[LSHR4]](s32)
    ; CHECK: [[COPY26:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY27:%[0-9]+]]:_(s32) = COPY [[LSHR5]](s32)
    ; CHECK: [[COPY28:%[0-9]+]]:_(s32) = COPY [[LSHR6]](s32)
    ; CHECK: [[COPY29:%[0-9]+]]:_(s32) = COPY [[LSHR7]](s32)
    ; CHECK: [[COPY30:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[COPY31:%[0-9]+]]:_(s32) = COPY [[LSHR8]](s32)
    ; CHECK: [[COPY32:%[0-9]+]]:_(s32) = COPY [[LSHR9]](s32)
    ; CHECK: [[COPY33:%[0-9]+]]:_(s32) = COPY [[LSHR10]](s32)
    ; CHECK: [[COPY34:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[COPY35:%[0-9]+]]:_(s32) = COPY [[LSHR11]](s32)
    ; CHECK: [[COPY36:%[0-9]+]]:_(s32) = COPY [[LSHR12]](s32)
    ; CHECK: [[COPY37:%[0-9]+]]:_(s32) = COPY [[LSHR13]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY22]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY23]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY24]](s32)
    ; CHECK: $vgpr3 = COPY [[COPY25]](s32)
    ; CHECK: $vgpr4 = COPY [[COPY26]](s32)
    ; CHECK: $vgpr5 = COPY [[COPY27]](s32)
    ; CHECK: $vgpr6 = COPY [[COPY28]](s32)
    ; CHECK: $vgpr7 = COPY [[COPY29]](s32)
    ; CHECK: $vgpr8 = COPY [[COPY30]](s32)
    ; CHECK: $vgpr9 = COPY [[COPY31]](s32)
    ; CHECK: $vgpr10 = COPY [[COPY32]](s32)
    ; CHECK: $vgpr11 = COPY [[COPY33]](s32)
    ; CHECK: $vgpr12 = COPY [[COPY34]](s32)
    ; CHECK: $vgpr13 = COPY [[COPY35]](s32)
    ; CHECK: $vgpr14 = COPY [[COPY36]](s32)
    ; CHECK: $vgpr15 = COPY [[COPY37]](s32)
    %0:_(p1) = COPY $vgpr0_vgpr1
    %1:_(s4), %2:_(s4), %3:_(s4), %4:_(s4), %5:_(s4), %6:_(s4), %7:_(s4), %8:_(s4), %9:_(s4), %10:_(s4), %11:_(s4), %12:_(s4), %13:_(s4), %14:_(s4), %15:_(s4), %16:_(s4) = G_UNMERGE_VALUES %0
    %17:_(s32) = G_ANYEXT %1
    %18:_(s32) = G_ANYEXT %2
    %19:_(s32) = G_ANYEXT %3
    %20:_(s32) = G_ANYEXT %4
    %21:_(s32) = G_ANYEXT %5
    %22:_(s32) = G_ANYEXT %6
    %23:_(s32) = G_ANYEXT %7
    %24:_(s32) = G_ANYEXT %8
    %25:_(s32) = G_ANYEXT %9
    %26:_(s32) = G_ANYEXT %10
    %27:_(s32) = G_ANYEXT %11
    %28:_(s32) = G_ANYEXT %12
    %29:_(s32) = G_ANYEXT %13
    %30:_(s32) = G_ANYEXT %14
    %31:_(s32) = G_ANYEXT %15
    %32:_(s32) = G_ANYEXT %16
    $vgpr0 = COPY %17
    $vgpr1 = COPY %18
    $vgpr2 = COPY %19
    $vgpr3 = COPY %20
    $vgpr4 = COPY %21
    $vgpr5 = COPY %22
    $vgpr6 = COPY %23
    $vgpr7 = COPY %24
    $vgpr8 = COPY %25
    $vgpr9 = COPY %26
    $vgpr10 = COPY %27
    $vgpr11 = COPY %28
    $vgpr12 = COPY %29
    $vgpr13 = COPY %30
    $vgpr14 = COPY %31
    $vgpr15 = COPY %32
...

---
name: test_unmerge_s16_p1
body: |
  bb.0:
    liveins: $vgpr0_vgpr1
    ; CHECK-LABEL: name: test_unmerge_s16_p1
    ; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](p1)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[UV]], [[C]](s32)
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[UV1]], [[C]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY3]](s32)
    ; CHECK: $vgpr3 = COPY [[COPY4]](s32)
    %0:_(p1) = COPY $vgpr0_vgpr1
    %1:_(s16), %2:_(s16), %3:_(s16), %4:_(s16) = G_UNMERGE_VALUES %0
    %5:_(s32) = G_ANYEXT %1
    %6:_(s32) = G_ANYEXT %2
    %7:_(s32) = G_ANYEXT %3
    %8:_(s32) = G_ANYEXT %4
    $vgpr0 = COPY %5
    $vgpr1 = COPY %6
    $vgpr2 = COPY %7
    $vgpr3 = COPY %8
...

---
name: test_unmerge_s32_p1
body: |
  bb.0:
    liveins: $vgpr0_vgpr1
    ; CHECK-LABEL: name: test_unmerge_s32_p1
    ; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](p1)
    ; CHECK: $vgpr0 = COPY [[UV]](s32)
    ; CHECK: $vgpr1 = COPY [[UV1]](s32)
    %0:_(p1) = COPY $vgpr0_vgpr1
    %1:_(s32), %2:_(s32) = G_UNMERGE_VALUES %0
    $vgpr0 = COPY %1
    $vgpr1 = COPY %2
...

---
name: test_unmerge_s16_s32
body: |
  bb.0:
    liveins: $vgpr0
    ; CHECK-LABEL: name: test_unmerge_s16_s32
    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    %0:_(s32) = COPY $vgpr0
    %1:_(s16), %2:_(s16) = G_UNMERGE_VALUES %0
    %3:_(s32) = G_ANYEXT %1
    %4:_(s32) = G_ANYEXT %2
    $vgpr0 = COPY %3
    $vgpr1 = COPY %4
...

---
name: test_unmerge_s16_p3
body: |
  bb.0:
    liveins: $vgpr0
    ; CHECK-LABEL: name: test_unmerge_s16_p3
    ; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
    ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p3)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[PTRTOINT]], [[C]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[PTRTOINT]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    %0:_(p3) = COPY $vgpr0
    %1:_(s16), %2:_(s16) = G_UNMERGE_VALUES %0
    %3:_(s32) = G_ANYEXT %1
    %4:_(s32) = G_ANYEXT %2
    $vgpr0 = COPY %3
    $vgpr1 = COPY %4
...

---
name: test_unmerge_s8_p3
body: |
  bb.0:
    liveins: $vgpr0
    ; CHECK-LABEL: name: test_unmerge_s8_p3
    ; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
    ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p3)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[PTRTOINT]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[PTRTOINT]], [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[PTRTOINT]], [[C2]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[PTRTOINT]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY3]](s32)
    ; CHECK: $vgpr3 = COPY [[COPY4]](s32)
    %0:_(p3) = COPY $vgpr0
    %1:_(s8), %2:_(s8), %3:_(s8), %4:_(s8) = G_UNMERGE_VALUES %0
    %5:_(s32) = G_ANYEXT %1
    %6:_(s32) = G_ANYEXT %2
    %7:_(s32) = G_ANYEXT %3
    %8:_(s32) = G_ANYEXT %4
    $vgpr0 = COPY %5
    $vgpr1 = COPY %6
    $vgpr2 = COPY %7
    $vgpr3 = COPY %8

...

---
name: test_unmerge_s16_s64
body: |
  bb.0:
    liveins: $vgpr0_vgpr1
    ; CHECK-LABEL: name: test_unmerge_s16_s64
    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[UV]], [[C]](s32)
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[UV1]], [[C]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY3]](s32)
    ; CHECK: $vgpr3 = COPY [[COPY4]](s32)
    %0:_(s64) = COPY $vgpr0_vgpr1
    %1:_(s16), %2:_(s16), %3:_(s16), %4:_(s16) = G_UNMERGE_VALUES %0
    %5:_(s32) = G_ANYEXT %1
    %6:_(s32) = G_ANYEXT %2
    %7:_(s32) = G_ANYEXT %3
    %8:_(s32) = G_ANYEXT %4
    $vgpr0 = COPY %5
    $vgpr1 = COPY %6
    $vgpr2 = COPY %7
    $vgpr3 = COPY %8
...

---
name: test_unmerge_s1_s3
body: |
  bb.0:
    liveins: $vgpr0
    ; CHECK-LABEL: name: test_unmerge_s1_s3
    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C2]](s32)
    ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
    ; CHECK: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C3]](s32)
    ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 5
    ; CHECK: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C4]](s32)
    ; CHECK: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 6
    ; CHECK: [[LSHR5:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C5]](s32)
    ; CHECK: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 7
    ; CHECK: [[LSHR6:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C6]](s32)
    ; CHECK: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[LSHR7:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C7]](s32)
    ; CHECK: [[C8:%[0-9]+]]:_(s32) = G_CONSTANT i32 9
    ; CHECK: [[LSHR8:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C8]](s32)
    ; CHECK: [[C9:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
    ; CHECK: [[LSHR9:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C9]](s32)
    ; CHECK: [[C10:%[0-9]+]]:_(s32) = G_CONSTANT i32 11
    ; CHECK: [[LSHR10:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C10]](s32)
    ; CHECK: [[C11:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
    ; CHECK: [[LSHR11:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C11]](s32)
    ; CHECK: [[C12:%[0-9]+]]:_(s32) = G_CONSTANT i32 13
    ; CHECK: [[LSHR12:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C12]](s32)
    ; CHECK: [[C13:%[0-9]+]]:_(s32) = G_CONSTANT i32 14
    ; CHECK: [[LSHR13:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C13]](s32)
    ; CHECK: [[C14:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
    ; CHECK: [[LSHR14:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C14]](s32)
    ; CHECK: [[C15:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR15:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C15]](s32)
    ; CHECK: [[C16:%[0-9]+]]:_(s32) = G_CONSTANT i32 17
    ; CHECK: [[LSHR16:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C16]](s32)
    ; CHECK: [[C17:%[0-9]+]]:_(s32) = G_CONSTANT i32 18
    ; CHECK: [[LSHR17:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C17]](s32)
    ; CHECK: [[C18:%[0-9]+]]:_(s32) = G_CONSTANT i32 19
    ; CHECK: [[LSHR18:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C18]](s32)
    ; CHECK: [[C19:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
    ; CHECK: [[LSHR19:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C19]](s32)
    ; CHECK: [[C20:%[0-9]+]]:_(s32) = G_CONSTANT i32 21
    ; CHECK: [[LSHR20:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C20]](s32)
    ; CHECK: [[C21:%[0-9]+]]:_(s32) = G_CONSTANT i32 22
    ; CHECK: [[LSHR21:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C21]](s32)
    ; CHECK: [[C22:%[0-9]+]]:_(s32) = G_CONSTANT i32 23
    ; CHECK: [[LSHR22:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C22]](s32)
    ; CHECK: [[C23:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK: [[LSHR23:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C23]](s32)
    ; CHECK: [[C24:%[0-9]+]]:_(s32) = G_CONSTANT i32 25
    ; CHECK: [[LSHR24:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C24]](s32)
    ; CHECK: [[C25:%[0-9]+]]:_(s32) = G_CONSTANT i32 26
    ; CHECK: [[LSHR25:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C25]](s32)
    ; CHECK: [[C26:%[0-9]+]]:_(s32) = G_CONSTANT i32 27
    ; CHECK: [[LSHR26:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C26]](s32)
    ; CHECK: [[C27:%[0-9]+]]:_(s32) = G_CONSTANT i32 28
    ; CHECK: [[LSHR27:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C27]](s32)
    ; CHECK: [[C28:%[0-9]+]]:_(s32) = G_CONSTANT i32 29
    ; CHECK: [[LSHR28:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C28]](s32)
    ; CHECK: [[C29:%[0-9]+]]:_(s32) = G_CONSTANT i32 30
    ; CHECK: [[LSHR29:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C29]](s32)
    ; CHECK: [[C30:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
    ; CHECK: [[LSHR30:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C30]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY3]](s32)
    %0:_(s32) = COPY $vgpr0
    %1:_(s3) = G_TRUNC %0
    %2:_(s1), %3:_(s1), %4:_(s1) = G_UNMERGE_VALUES %1
    %5:_(s32) = G_ANYEXT %2
    %6:_(s32) = G_ANYEXT %3
    %7:_(s32) = G_ANYEXT %4
    $vgpr0 = COPY %5
    $vgpr1 = COPY %6
    $vgpr2 = COPY %7
...

---
name: test_unmerge_s1_s8
body: |
  bb.0:
    liveins: $vgpr0
    ; CHECK-LABEL: name: test_unmerge_s1_s8
    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C2]](s32)
    ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
    ; CHECK: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C3]](s32)
    ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 5
    ; CHECK: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C4]](s32)
    ; CHECK: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 6
    ; CHECK: [[LSHR5:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C5]](s32)
    ; CHECK: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 7
    ; CHECK: [[LSHR6:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C6]](s32)
    ; CHECK: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[LSHR7:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C7]](s32)
    ; CHECK: [[C8:%[0-9]+]]:_(s32) = G_CONSTANT i32 9
    ; CHECK: [[LSHR8:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C8]](s32)
    ; CHECK: [[C9:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
    ; CHECK: [[LSHR9:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C9]](s32)
    ; CHECK: [[C10:%[0-9]+]]:_(s32) = G_CONSTANT i32 11
    ; CHECK: [[LSHR10:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C10]](s32)
    ; CHECK: [[C11:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
    ; CHECK: [[LSHR11:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C11]](s32)
    ; CHECK: [[C12:%[0-9]+]]:_(s32) = G_CONSTANT i32 13
    ; CHECK: [[LSHR12:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C12]](s32)
    ; CHECK: [[C13:%[0-9]+]]:_(s32) = G_CONSTANT i32 14
    ; CHECK: [[LSHR13:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C13]](s32)
    ; CHECK: [[C14:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
    ; CHECK: [[LSHR14:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C14]](s32)
    ; CHECK: [[C15:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR15:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C15]](s32)
    ; CHECK: [[C16:%[0-9]+]]:_(s32) = G_CONSTANT i32 17
    ; CHECK: [[LSHR16:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C16]](s32)
    ; CHECK: [[C17:%[0-9]+]]:_(s32) = G_CONSTANT i32 18
    ; CHECK: [[LSHR17:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C17]](s32)
    ; CHECK: [[C18:%[0-9]+]]:_(s32) = G_CONSTANT i32 19
    ; CHECK: [[LSHR18:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C18]](s32)
    ; CHECK: [[C19:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
    ; CHECK: [[LSHR19:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C19]](s32)
    ; CHECK: [[C20:%[0-9]+]]:_(s32) = G_CONSTANT i32 21
    ; CHECK: [[LSHR20:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C20]](s32)
    ; CHECK: [[C21:%[0-9]+]]:_(s32) = G_CONSTANT i32 22
    ; CHECK: [[LSHR21:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C21]](s32)
    ; CHECK: [[C22:%[0-9]+]]:_(s32) = G_CONSTANT i32 23
    ; CHECK: [[LSHR22:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C22]](s32)
    ; CHECK: [[C23:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK: [[LSHR23:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C23]](s32)
    ; CHECK: [[C24:%[0-9]+]]:_(s32) = G_CONSTANT i32 25
    ; CHECK: [[LSHR24:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C24]](s32)
    ; CHECK: [[C25:%[0-9]+]]:_(s32) = G_CONSTANT i32 26
    ; CHECK: [[LSHR25:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C25]](s32)
    ; CHECK: [[C26:%[0-9]+]]:_(s32) = G_CONSTANT i32 27
    ; CHECK: [[LSHR26:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C26]](s32)
    ; CHECK: [[C27:%[0-9]+]]:_(s32) = G_CONSTANT i32 28
    ; CHECK: [[LSHR27:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C27]](s32)
    ; CHECK: [[C28:%[0-9]+]]:_(s32) = G_CONSTANT i32 29
    ; CHECK: [[LSHR28:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C28]](s32)
    ; CHECK: [[C29:%[0-9]+]]:_(s32) = G_CONSTANT i32 30
    ; CHECK: [[LSHR29:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C29]](s32)
    ; CHECK: [[C30:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
    ; CHECK: [[LSHR30:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C30]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
    ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[LSHR3]](s32)
    ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[LSHR4]](s32)
    ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[LSHR5]](s32)
    ; CHECK: [[COPY8:%[0-9]+]]:_(s32) = COPY [[LSHR6]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY3]](s32)
    ; CHECK: $vgpr3 = COPY [[COPY4]](s32)
    ; CHECK: $vgpr4 = COPY [[COPY5]](s32)
    ; CHECK: $vgpr5 = COPY [[COPY6]](s32)
    ; CHECK: $vgpr6 = COPY [[COPY7]](s32)
    ; CHECK: $vgpr7 = COPY [[COPY8]](s32)
    %0:_(s32) = COPY $vgpr0
    %1:_(s8) = G_TRUNC %0
    %2:_(s1), %3:_(s1), %4:_(s1), %5:_(s1), %6:_(s1), %7:_(s1), %8:_(s1), %9:_(s1) = G_UNMERGE_VALUES %1
    %10:_(s32) = G_ANYEXT %2
    %11:_(s32) = G_ANYEXT %3
    %12:_(s32) = G_ANYEXT %4
    %13:_(s32) = G_ANYEXT %5
    %14:_(s32) = G_ANYEXT %6
    %15:_(s32) = G_ANYEXT %7
    %16:_(s32) = G_ANYEXT %8
    %17:_(s32) = G_ANYEXT %9
    $vgpr0 = COPY %10
    $vgpr1 = COPY %11
    $vgpr2 = COPY %12
    $vgpr3 = COPY %13
    $vgpr4 = COPY %14
    $vgpr5 = COPY %15
    $vgpr6 = COPY %16
    $vgpr7 = COPY %17
...

---

name: test_unmerge_s128_v2s128
body: |
  bb.0:
    liveins:  $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
    ; CHECK-LABEL: name: test_unmerge_s128_v2s128
    ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s128>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
    ; CHECK: [[UV:%[0-9]+]]:_(s128), [[UV1:%[0-9]+]]:_(s128) = G_UNMERGE_VALUES [[COPY]](<2 x s128>)
    ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[UV]](s128)
    ; CHECK: $vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[UV1]](s128)
    %0:_(<2 x s128>) = COPY  $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
    %1:_(s128), %2:_(s128) = G_UNMERGE_VALUES %0
    $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
    $vgpr4_vgpr5_vgpr6_vgpr7 = COPY %2
...

---

name: test_unmerge_s128_s256
body: |
  bb.0:
    liveins:  $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
    ; CHECK-LABEL: name: test_unmerge_s128_s256
    ; CHECK: [[COPY:%[0-9]+]]:_(s256) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
    ; CHECK: [[UV:%[0-9]+]]:_(s128), [[UV1:%[0-9]+]]:_(s128) = G_UNMERGE_VALUES [[COPY]](s256)
    ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[UV]](s128)
    ; CHECK: $vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[UV1]](s128)
    %0:_(s256) = COPY  $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7
    %1:_(s128), %2:_(s128) = G_UNMERGE_VALUES %0
    $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
    $vgpr4_vgpr5_vgpr6_vgpr7 = COPY %2
...

---

name: test_unmerge_s256_s512
body: |
  bb.0:
    liveins:  $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15

    ; CHECK-LABEL: name: test_unmerge_s256_s512
    ; CHECK: [[COPY:%[0-9]+]]:_(s512) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
    ; CHECK: [[UV:%[0-9]+]]:_(s256), [[UV1:%[0-9]+]]:_(s256) = G_UNMERGE_VALUES [[COPY]](s512)
    ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[UV]](s256)
    ; CHECK: $vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15 = COPY [[UV1]](s256)
    %0:_(s512) = COPY  $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
    %1:_(s256), %2:_(s256) = G_UNMERGE_VALUES %0
    $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %1
    $vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15 = COPY %2
...

---

name: test_unmerge_s256_v2s256
body: |
  bb.0:
    liveins:  $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15

    ; CHECK-LABEL: name: test_unmerge_s256_v2s256
    ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s256>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
    ; CHECK: [[UV:%[0-9]+]]:_(s256), [[UV1:%[0-9]+]]:_(s256) = G_UNMERGE_VALUES [[COPY]](<2 x s256>)
    ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[UV]](s256)
    ; CHECK: $vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15 = COPY [[UV1]](s256)
    %0:_(<2 x s256>) = COPY  $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
    %1:_(s256), %2:_(s256) = G_UNMERGE_VALUES %0
    $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %1
    $vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15 = COPY %2
...

---

name: test_unmerge_s512_s1024
body: |
  bb.0:
    liveins:  $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16_vgpr17_vgpr18_vgpr19_vgpr20_vgpr21_vgpr22_vgpr23_vgpr24_vgpr25_vgpr26_vgpr27_vgpr28_vgpr29_vgpr30_vgpr31

    ; CHECK-LABEL: name: test_unmerge_s512_s1024
    ; CHECK: [[COPY:%[0-9]+]]:_(s1024) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16_vgpr17_vgpr18_vgpr19_vgpr20_vgpr21_vgpr22_vgpr23_vgpr24_vgpr25_vgpr26_vgpr27_vgpr28_vgpr29_vgpr30_vgpr31
    ; CHECK: [[UV:%[0-9]+]]:_(s512), [[UV1:%[0-9]+]]:_(s512) = G_UNMERGE_VALUES [[COPY]](s1024)
    ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15 = COPY [[UV]](s512)
    ; CHECK: $vgpr16_vgpr17_vgpr18_vgpr19_vgpr20_vgpr21_vgpr22_vgpr23_vgpr24_vgpr25_vgpr26_vgpr27_vgpr28_vgpr29_vgpr30_vgpr31 = COPY [[UV1]](s512)
    %0:_(s1024) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16_vgpr17_vgpr18_vgpr19_vgpr20_vgpr21_vgpr22_vgpr23_vgpr24_vgpr25_vgpr26_vgpr27_vgpr28_vgpr29_vgpr30_vgpr31
    %1:_(s512), %2:_(s512) = G_UNMERGE_VALUES %0
    $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15 = COPY %1
    $vgpr16_vgpr17_vgpr18_vgpr19_vgpr20_vgpr21_vgpr22_vgpr23_vgpr24_vgpr25_vgpr26_vgpr27_vgpr28_vgpr29_vgpr30_vgpr31 = COPY %2
...

---

name: test_unmerge_s512_v2s512
body: |
  bb.0:
    liveins:  $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16_vgpr17_vgpr18_vgpr19_vgpr20_vgpr21_vgpr22_vgpr23_vgpr24_vgpr25_vgpr26_vgpr27_vgpr28_vgpr29_vgpr30_vgpr31

    ; CHECK-LABEL: name: test_unmerge_s512_v2s512
    ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s512>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16_vgpr17_vgpr18_vgpr19_vgpr20_vgpr21_vgpr22_vgpr23_vgpr24_vgpr25_vgpr26_vgpr27_vgpr28_vgpr29_vgpr30_vgpr31
    ; CHECK: [[UV:%[0-9]+]]:_(s512), [[UV1:%[0-9]+]]:_(s512) = G_UNMERGE_VALUES [[COPY]](<2 x s512>)
    ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15 = COPY [[UV]](s512)
    ; CHECK: $vgpr16_vgpr17_vgpr18_vgpr19_vgpr20_vgpr21_vgpr22_vgpr23_vgpr24_vgpr25_vgpr26_vgpr27_vgpr28_vgpr29_vgpr30_vgpr31 = COPY [[UV1]](s512)
    %0:_(<2 x s512>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16_vgpr17_vgpr18_vgpr19_vgpr20_vgpr21_vgpr22_vgpr23_vgpr24_vgpr25_vgpr26_vgpr27_vgpr28_vgpr29_vgpr30_vgpr31
    %1:_(s512), %2:_(s512) = G_UNMERGE_VALUES %0
    $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15 = COPY %1
    $vgpr16_vgpr17_vgpr18_vgpr19_vgpr20_vgpr21_vgpr22_vgpr23_vgpr24_vgpr25_vgpr26_vgpr27_vgpr28_vgpr29_vgpr30_vgpr31 = COPY %2
...

---
name: test_unmerge_v2s1
body: |
  bb.0:
    ; CHECK-LABEL: name: test_unmerge_v2s1
    ; CHECK: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<2 x s32>)
    ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[UV]](s32)
    ; CHECK: [[TRUNC1:%[0-9]+]]:_(s1) = G_TRUNC [[UV1]](s32)
    ; CHECK: S_NOP 0, implicit [[TRUNC]](s1)
    ; CHECK: S_NOP 0, implicit [[TRUNC1]](s1)
    %0:_(<2 x s1>) = G_IMPLICIT_DEF
    %1:_(s1), %2:_(s1) = G_UNMERGE_VALUES %0
    S_NOP 0, implicit %1
    S_NOP 0, implicit %2
...

---
name: test_unmerge_s8_v4s8
body: |
  bb.0:
    liveins: $vgpr0

    ; CHECK-LABEL: name: test_unmerge_s8_v4s8
    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C2]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY3]](s32)
    ; CHECK: $vgpr3 = COPY [[COPY4]](s32)
    %0:_(s32) = COPY $vgpr0
    %1:_(<4 x s8>) = G_BITCAST %0
    %2:_(s8), %3:_(s8),  %4:_(s8), %5:_(s8) = G_UNMERGE_VALUES %1
    %6:_(s32) = G_ANYEXT %2
    %7:_(s32) = G_ANYEXT %3
    %8:_(s32) = G_ANYEXT %4
    %9:_(s32) = G_ANYEXT %5
    $vgpr0 = COPY %6
    $vgpr1 = COPY %7
    $vgpr2 = COPY %8
    $vgpr3 = COPY %9
...

---
name: test_unmerge_s8_v3s8
body: |
  bb.0:
    liveins: $vgpr0

    ; CHECK-LABEL: name: test_unmerge_s8_v3s8
    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C2]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    ; CHECK: $vgpr2 = COPY [[COPY3]](s32)
    %0:_(s32) = COPY $vgpr0
    %1:_(s24) = G_TRUNC %0
    %2:_(<3 x s8>) = G_BITCAST %1
    %3:_(s8), %4:_(s8),  %5:_(s8) = G_UNMERGE_VALUES %2
    %6:_(s32) = G_ANYEXT %3
    %7:_(s32) = G_ANYEXT %4
    %8:_(s32) = G_ANYEXT %5
    $vgpr0 = COPY %6
    $vgpr1 = COPY %7
    $vgpr2 = COPY %8
...

---
name: test_unmerge_s8_v2s8
body: |
  bb.0:
    liveins: $vgpr0

    ; CHECK-LABEL: name: test_unmerge_s8_v2s8
    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C2]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
    ; CHECK: $vgpr1 = COPY [[COPY2]](s32)
    %0:_(s32) = COPY $vgpr0
    %1:_(s16) = G_TRUNC %0
    %2:_(<2 x s8>) = G_BITCAST %1
    %3:_(s8), %4:_(s8) = G_UNMERGE_VALUES %2
    %5:_(s32) = G_ANYEXT %3
    %6:_(s32) = G_ANYEXT %4
    $vgpr0 = COPY %5
    $vgpr1 = COPY %6

...

---
name: test_unmerge_v3s32_v12s32
body: |
  bb.0:
    liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5, $vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11

    ; CHECK-LABEL: name: test_unmerge_v3s32_v12s32
    ; CHECK: [[COPY:%[0-9]+]]:_(<6 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5
    ; CHECK: [[COPY1:%[0-9]+]]:_(<6 x s32>) = COPY $vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11
    ; CHECK: [[UV:%[0-9]+]]:_(<3 x s32>), [[UV1:%[0-9]+]]:_(<3 x s32>) = G_UNMERGE_VALUES [[COPY]](<6 x s32>)
    ; CHECK: [[UV2:%[0-9]+]]:_(<3 x s32>), [[UV3:%[0-9]+]]:_(<3 x s32>) = G_UNMERGE_VALUES [[COPY1]](<6 x s32>)
    ; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[UV]](<3 x s32>)
    ; CHECK: $vgpr3_vgpr4_vgpr5 = COPY [[UV1]](<3 x s32>)
    ; CHECK: $vgpr6_vgpr7_vgpr8 = COPY [[UV2]](<3 x s32>)
    ; CHECK: $vgpr9_vgpr10_vgpr11 = COPY [[UV3]](<3 x s32>)
    %0:_(<6 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5
    %1:_(<6 x s32>) = COPY $vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11
    %2:_(<12 x s32>) = G_CONCAT_VECTORS %0, %1
    %3:_(<3 x s32>), %4:_(<3 x s32>), %5:_(<3 x s32>), %6:_(<3 x s32>) = G_UNMERGE_VALUES %2
    $vgpr0_vgpr1_vgpr2 = COPY %3
    $vgpr3_vgpr4_vgpr5 = COPY %4
    $vgpr6_vgpr7_vgpr8 = COPY %5
    $vgpr9_vgpr10_vgpr11 = COPY %6

...

---
name: test_unmerge_v3s8_v12s8
body: |
  bb.0:
    liveins: $vgpr0_vgpr1_vgpr2

    ; CHECK-LABEL: name: test_unmerge_v3s8_v12s8
    ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[UV]], [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[UV]], [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[UV]], [[C2]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
    ; CHECK: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[UV1]], [[C]](s32)
    ; CHECK: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[UV1]], [[C1]](s32)
    ; CHECK: [[LSHR5:%[0-9]+]]:_(s32) = G_LSHR [[UV1]], [[C2]](s32)
    ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
    ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[LSHR3]](s32)
    ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[LSHR4]](s32)
    ; CHECK: [[COPY8:%[0-9]+]]:_(s32) = COPY [[LSHR5]](s32)
    ; CHECK: [[LSHR6:%[0-9]+]]:_(s32) = G_LSHR [[UV2]], [[C]](s32)
    ; CHECK: [[LSHR7:%[0-9]+]]:_(s32) = G_LSHR [[UV2]], [[C1]](s32)
    ; CHECK: [[LSHR8:%[0-9]+]]:_(s32) = G_LSHR [[UV2]], [[C2]](s32)
    ; CHECK: [[COPY9:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
    ; CHECK: [[COPY10:%[0-9]+]]:_(s32) = COPY [[LSHR6]](s32)
    ; CHECK: [[COPY11:%[0-9]+]]:_(s32) = COPY [[LSHR7]](s32)
    ; CHECK: [[COPY12:%[0-9]+]]:_(s32) = COPY [[LSHR8]](s32)
    ; CHECK: [[COPY13:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
    ; CHECK: [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
    ; CHECK: [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
    ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[COPY13]](s32), [[COPY14]](s32), [[COPY15]](s32)
    ; CHECK: [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
    ; CHECK: [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
    ; CHECK: [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY6]](s32)
    ; CHECK: [[BUILD_VECTOR1:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[COPY16]](s32), [[COPY17]](s32), [[COPY18]](s32)
    ; CHECK: [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY7]](s32)
    ; CHECK: [[COPY20:%[0-9]+]]:_(s32) = COPY [[COPY8]](s32)
    ; CHECK: [[COPY21:%[0-9]+]]:_(s32) = COPY [[COPY9]](s32)
    ; CHECK: [[BUILD_VECTOR2:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[COPY19]](s32), [[COPY20]](s32), [[COPY21]](s32)
    ; CHECK: [[COPY22:%[0-9]+]]:_(s32) = COPY [[COPY10]](s32)
    ; CHECK: [[COPY23:%[0-9]+]]:_(s32) = COPY [[COPY11]](s32)
    ; CHECK: [[COPY24:%[0-9]+]]:_(s32) = COPY [[COPY12]](s32)
    ; CHECK: [[BUILD_VECTOR3:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[COPY22]](s32), [[COPY23]](s32), [[COPY24]](s32)
    ; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[BUILD_VECTOR]](<3 x s32>)
    ; CHECK: $vgpr3_vgpr4_vgpr5 = COPY [[BUILD_VECTOR1]](<3 x s32>)
    ; CHECK: $vgpr6_vgpr7_vgpr8 = COPY [[BUILD_VECTOR2]](<3 x s32>)
    ; CHECK: $vgpr9_vgpr10_vgpr11 = COPY [[BUILD_VECTOR3]](<3 x s32>)
    %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
    %1:_(<12 x s8>) = G_BITCAST %0
    %2:_(<3 x s8>), %3:_(<3 x s8>), %4:_(<3 x s8>), %5:_(<3 x s8>) = G_UNMERGE_VALUES %1
    %6:_(<3 x s32>) = G_ANYEXT %2
    %7:_(<3 x s32>) = G_ANYEXT %3
    %8:_(<3 x s32>) = G_ANYEXT %4
    %9:_(<3 x s32>) = G_ANYEXT %5
    $vgpr0_vgpr1_vgpr2 = COPY %6
    $vgpr3_vgpr4_vgpr5 = COPY %7
    $vgpr6_vgpr7_vgpr8 = COPY %8
    $vgpr9_vgpr10_vgpr11 = COPY %9

...

---
name: test_unmerge_v3s16_v12s16
body: |
  bb.0:
    liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5

    ; CHECK-LABEL: name: test_unmerge_v3s16_v12s16
    ; CHECK: [[COPY:%[0-9]+]]:_(<12 x s16>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5
    ; CHECK: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>), [[UV2:%[0-9]+]]:_(<2 x s16>), [[UV3:%[0-9]+]]:_(<2 x s16>), [[UV4:%[0-9]+]]:_(<2 x s16>), [[UV5:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<12 x s16>)
    ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
    ; CHECK: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
    ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
    ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[COPY1]](s32), [[COPY2]](s32), [[COPY3]](s32)
    ; CHECK: [[UV6:%[0-9]+]]:_(<2 x s16>), [[UV7:%[0-9]+]]:_(<2 x s16>), [[UV8:%[0-9]+]]:_(<2 x s16>), [[UV9:%[0-9]+]]:_(<2 x s16>), [[UV10:%[0-9]+]]:_(<2 x s16>), [[UV11:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<12 x s16>)
    ; CHECK: [[BITCAST2:%[0-9]+]]:_(s32) = G_BITCAST [[UV7]](<2 x s16>)
    ; CHECK: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST2]], [[C]](s32)
    ; CHECK: [[BITCAST3:%[0-9]+]]:_(s32) = G_BITCAST [[UV8]](<2 x s16>)
    ; CHECK: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST3]], [[C]](s32)
    ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
    ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[BITCAST3]](s32)
    ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[LSHR3]](s32)
    ; CHECK: [[BUILD_VECTOR1:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[COPY4]](s32), [[COPY5]](s32), [[COPY6]](s32)
    ; CHECK: [[UV12:%[0-9]+]]:_(<2 x s16>), [[UV13:%[0-9]+]]:_(<2 x s16>), [[UV14:%[0-9]+]]:_(<2 x s16>), [[UV15:%[0-9]+]]:_(<2 x s16>), [[UV16:%[0-9]+]]:_(<2 x s16>), [[UV17:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<12 x s16>)
    ; CHECK: [[BITCAST4:%[0-9]+]]:_(s32) = G_BITCAST [[UV15]](<2 x s16>)
    ; CHECK: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST4]], [[C]](s32)
    ; CHECK: [[BITCAST5:%[0-9]+]]:_(s32) = G_BITCAST [[UV16]](<2 x s16>)
    ; CHECK: [[LSHR5:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST5]], [[C]](s32)
    ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[BITCAST4]](s32)
    ; CHECK: [[COPY8:%[0-9]+]]:_(s32) = COPY [[LSHR4]](s32)
    ; CHECK: [[COPY9:%[0-9]+]]:_(s32) = COPY [[BITCAST5]](s32)
    ; CHECK: [[BUILD_VECTOR2:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[COPY7]](s32), [[COPY8]](s32), [[COPY9]](s32)
    ; CHECK: [[UV18:%[0-9]+]]:_(<2 x s16>), [[UV19:%[0-9]+]]:_(<2 x s16>), [[UV20:%[0-9]+]]:_(<2 x s16>), [[UV21:%[0-9]+]]:_(<2 x s16>), [[UV22:%[0-9]+]]:_(<2 x s16>), [[UV23:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<12 x s16>)
    ; CHECK: [[BITCAST6:%[0-9]+]]:_(s32) = G_BITCAST [[UV22]](<2 x s16>)
    ; CHECK: [[LSHR6:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST6]], [[C]](s32)
    ; CHECK: [[BITCAST7:%[0-9]+]]:_(s32) = G_BITCAST [[UV23]](<2 x s16>)
    ; CHECK: [[LSHR7:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST7]], [[C]](s32)
    ; CHECK: [[COPY10:%[0-9]+]]:_(s32) = COPY [[LSHR6]](s32)
    ; CHECK: [[COPY11:%[0-9]+]]:_(s32) = COPY [[BITCAST7]](s32)
    ; CHECK: [[COPY12:%[0-9]+]]:_(s32) = COPY [[LSHR7]](s32)
    ; CHECK: [[BUILD_VECTOR3:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[COPY10]](s32), [[COPY11]](s32), [[COPY12]](s32)
    ; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[BUILD_VECTOR]](<3 x s32>)
    ; CHECK: $vgpr3_vgpr4_vgpr5 = COPY [[BUILD_VECTOR1]](<3 x s32>)
    ; CHECK: $vgpr6_vgpr7_vgpr8 = COPY [[BUILD_VECTOR2]](<3 x s32>)
    ; CHECK: $vgpr9_vgpr10_vgpr11 = COPY [[BUILD_VECTOR3]](<3 x s32>)
    %0:_(<12 x s16>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5
    %1:_(<3 x s16>), %2:_(<3 x s16>), %3:_(<3 x s16>), %4:_(<3 x s16>) = G_UNMERGE_VALUES %0
    %5:_(<3 x s32>) = G_ANYEXT %1
    %6:_(<3 x s32>) = G_ANYEXT %2
    %7:_(<3 x s32>) = G_ANYEXT %3
    %8:_(<3 x s32>) = G_ANYEXT %4
    $vgpr0_vgpr1_vgpr2 = COPY %5
    $vgpr3_vgpr4_vgpr5 = COPY %6
    $vgpr6_vgpr7_vgpr8 = COPY %7
    $vgpr9_vgpr10_vgpr11 = COPY %8

...
